#define  _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

#include <string.h>
#include <stdbool.h>

bool CheckPermutation(char* s1, char* s2) {
    if (strlen(s1) != strlen(s2))
    {
        return false;
    }
    else
    {
        char str[7];

        strcat(str, s1);
        strcat(str + strlen(s1), s1);

        if (strstr(str, s2))
            return true;

        return false;
    }
}

int main()
{
    char* s1 = "abc";
    char* s2 = "cab";

    printf("%d\n", CheckPermutation(s1, s2));

    return 0;
}